﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebAppWithDataEnum.Configuration
{
    public class PropertyControls
    {
        private TextBox nameTextBox;

        public TextBox NameTextBox
        {
            get { return nameTextBox; }
            set { nameTextBox = value; }
        }

        private DropDownList typeDropDownList;

        public DropDownList TypeDropDownList
        {
            get { return typeDropDownList; }
            set { typeDropDownList = value; }
        }

        private TextBox sizeTextBox;

        public TextBox SizeTextBox
        {
            get { return sizeTextBox; }
            set { sizeTextBox = value; }
        }

        private CheckBox primaryCheckBox;

        public CheckBox PrimaryCheckBox
        {
            get { return primaryCheckBox; }
            set { primaryCheckBox = value; }
        }

        public PropertyControls(int propertyNumber)
        {

            this.nameTextBox = new TextBox();
            this.nameTextBox.ID = "txtProperty" + propertyNumber.ToString();
            this.typeDropDownList = new DropDownList();
            this.typeDropDownList.ID ="drpProperty" + propertyNumber.ToString();
            this.typeDropDownList.Items.Add("System.Int32");
            this.typeDropDownList.Items.Add("System.Int64");
            this.typeDropDownList.Items.Add("System.DateTime");
            //this.typeDropDownList.Items.Add("System.Boolean");
            this.typeDropDownList.Items.Add("System.Double");
            this.typeDropDownList.Items.Add("System.String");
            this.sizeTextBox = new TextBox();
            this.sizeTextBox.Width = 40;
            this.sizeTextBox.ID = "txtSize" + propertyNumber.ToString();
            this.sizeTextBox.Text = "0";
            this.primaryCheckBox = new CheckBox();
            this.primaryCheckBox.ID = "chkPrimary" + propertyNumber.ToString();
            this.primaryCheckBox.Text = "PrimaryKey";

        }

    }
}
